package com.edu.exam.enums.assessment.generation;

import com.edu.exam.enums.core.BaseEnum;

/**
 * 审核状态枚举
 *
 * @author 系统生成
 * @version 2.0
 * @since 2025-11-09
 */
public enum ReviewStatus implements BaseEnum {
    PENDING("PENDING", "待审核"),
    APPROVED("APPROVED", "已通过"),
    REJECTED("REJECTED", "已拒绝"),
    NEED_REVISION("NEED_REVISION", "需修改");

    private final String code;
    private final String description;

    ReviewStatus(String code, String description) {
        this.code = code;
        this.description = description;
    }

    @Override
    public String getCode() {
        return code;
    }

    @Override
    public String getDescription() {
        return description;
    }

    public static ReviewStatus fromCode(String code) {
        for (ReviewStatus status : values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        throw new IllegalArgumentException("Unknown review status code: " + code);
    }
    @Override
    public String toString() {
        return code + " - " + description;
    }
}